<button
  type="button"
  mat-icon-button
  mat-dialog-close=""
  style="float: right; margin: 1px"
>
  <mat-icon> close</mat-icon>
</button>

<header class="p-4">
  <h1>Создать задачу</h1>
</header>

<form [formGroup]="myFormTask" (ngSubmit)="onSubmit()">
  <div mat-dialog-content>
    <mat-form-field>
      <mat-select placeholder="Группа задач">
        <mat-form-field class="example-full-width">
          <input
            matInput
            placeholder="New group"
            type="text"
            formControlName="taskGroup"
            #itemName
          />
        </mat-form-field>

        <button
          mat-raised-button
          color="primary"
          (click)="addNewTaskGroup(itemName.id); itemName.id = ''"
        >
          Добавить
        </button>

        <mat-option
          *ngFor="let taskGroup of taskGroups; trackBy: trackByFn"
          [value]="taskGroup.id"
        >
          {{ taskGroup.title }}
        </mat-option>
      </mat-select>
    </mat-form-field>

    <mat-form-field>
      <mat-label>Текст задачи</mat-label>
      <textarea matInput type="text" formControlName="text"></textarea>
    </mat-form-field>

    <mat-dialog-actions style="padding: 0;">
      <button [hidden]="isEditForm" type="submit" mat-raised-button color="primary" style="margin-left: 0;">Создать</button>
      <button [hidden]="isCreateForm" type="submit" mat-raised-button color="primary" style="margin-left: 0;">Изменить</button>
    </mat-dialog-actions>
  </div>
</form>
